import { createRouter, createWebHistory,createWebHashHistory } from "vue-router";

import index from "../views/index.vue";
import main from "../views/main.vue";
import exhibitionDetail from "../views/exhibitionDetail.vue";
import hotelDetail from "../views/hotelDetail.vue";
import exhibitionPerview from "../views/exhibitionPerview.vue";
import exhibitionIntro from "../views/exhibitionIntro.vue";
import hotelRoomDetail from "../views/hotelRoomDetail.vue";
import hotelIntro from "../views/hotelIntro.vue";
import myOrder from "../views/myOrder.vue";
import orderDetail from "../views/orderDetail.vue";
import userCenter from "@/views/userCenter.vue";
import commonContactsPerson from "@/views/commonContactsPerson.vue";
import myFavorites from "../views/myFavorites.vue";
import service from "../views/customerService.vue";
import myCoupon from "../views/myCoupon.vue";
import myWallet from "../views/myWallet.vue";
import myIntegral from "../views/myIntegral.vue";
import myTool from "../views/myTool.vue";
import orderInfo from "../views/orderInfo.vue";

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      redirect: "/main",
      component: index,
      children: [
        // 登录注册的3个页面
        {
          path: "/login",
          name: "login",
          component: () => import("@/views/LoginPage.vue"),
        },
        {
          path: "/register",
          name: "register",
          component: () => import("@/views/RegisterPage.vue"),
        },
        {
          path: "/reset",
          name: "reset",
          component: () => import("@/views/ResetPage.vue"),
        },

        {
          path: "/main",
          name: "main",
          component: main,
        },
        {
          path: "/exhibitionDetail",
          name: "exhibitionDetail",
          component: exhibitionDetail,
        },
        {
          path: "/hotelDetail",
          name: "hotelDetail",
          component: hotelDetail,
        },
        {
          path: "/exhibitionPerview",
          name: "exhibitionPerview",
          component: exhibitionPerview,
        },
        {
          path: "/exhibitionIntro",
          name: "exhibitionIntro",
          component: exhibitionIntro,
        },
        {
          path: "/hotelRoomDetail",
          name: "hotelRoomDetail",
          component: hotelRoomDetail,
        },
        {
          path: "/hotelIntro",
          name: "hotelIntro",
          component: hotelIntro,
        },
        {
          path: "/myOrder",
          name: "myOrder",
          component: myOrder,
        },
        {
          path: "/orderDetail",
          name: "orderDetail",
          component: orderDetail,
        },
        {
          path: "/userCenter",
          name: "userCenter",
          component: userCenter,
        },
        {
          path: "/commonContactsPerson",
          name: "commonContactsPerson",
          component: commonContactsPerson,
        },
        {
          path: "/myFavorites",
          name: "myFavorites",
          component: myFavorites,
        },
        {
          path: "/service",
          name: "service",
          component: service,
        },
        {
          path: "/myCoupon",
          name: "myCoupon",
          component: myCoupon,
        },
        {
          path: "/myWallet",
          name: "myWallet",
          component: myWallet,
        },
        {
          path: "/myIntegral",
          name: "myIntegral",
          component: myIntegral,
        },
        {
          path: "/myTool",
          name: "myTool",
          component: myTool,
        },
        {
          path: "/orderInfo",
          name: "orderInfo",
          component: orderInfo,
        },
        {
          path: "/exhibitionHotel",
          name: "exhibitionHotel",
          component: () => import("@/views/exhibitionHotel.vue"),
        },
        {
          path: "/myHistory",
          name: "myHistory",
          component: () => import("@/views/myHistory.vue"),
        },
      ],
    },
  ],
});

export default router;
